package com.heima.article.controller;

import com.heima.article.service.ApAuthorService;
import com.heima.model.article.dtos.AuthorDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AuthorController {

    @Autowired
    private ApAuthorService apAuthorService;
    /**
     * 保存作者
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/author/save")
    public Integer saveAuthor(@RequestBody AuthorDto dto){
        return apAuthorService.saveAuthor(dto);
    }
}
